﻿
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #faf9f6;
  min-height: 100vh;
  padding: 24px;
}

/* =============================================
   AREA 1 + AREA 2 : TOP ROW
   Left  = icon (with dropdown)
   Right = compact bar, same height as icon
   ============================================= */
.top-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

/* ---------- AREA 1 : top-left icon + dropdown ---------- */
.icon-container {
  position: relative;
  flex-shrink: 0;
}

.icon-btn {
  background: white;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s;
  color: #1e1e1e;
  border: 1px solid #f0f0f0;
}

.icon-btn:hover {
  background: #ffffff;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.02);
  transform: scale(1.02);
}

.icon-btn:active {
  transform: scale(0.97);
  background: #f5f5f5;
}

.icon-btn svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.2s ease;
}

.icon-btn:hover svg {
  transform: rotate(3deg);
}

/* dropdown menu below icon */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 230px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0f0f0;
  padding: 8px;
  z-index: 1001;
  
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transform-origin: top left;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid #f0f0f0;
  border-top: 1px solid #f0f0f0;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #1e1e1e;
  font-size: 0.95rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: #f2f6fa;
  color: #0b3b5c;
}

.dropdown-item:active {
  background: #e6eef7;
}

.dropdown-item .emoji {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 6px 8px;
}

/* ---------- AREA 2 : compact bar on the right ----------
   Same height as the icon (52px), stretches to fill space.
*/
.compact-bar {
  flex: 1;
  height: 52px;                /* exactly the same height as the icon */
  background: white;
  border-radius: 26px;         /* fully rounded pill */
  border: 1px solid #eef2f6;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  min-width: 0;
}

.bar-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0b3b5c 0%, #1d6fa5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

/* search bar inside the compact area */
.bar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: #f2f6fa;
  border: 1px solid #e2eaf1;
  border-radius: 60px;
  padding: 3px 3px 3px 14px;
  min-width: 0;
  max-width: 420px;
  margin-left: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bar-search:focus-within {
  border-color: #b6cde0;
  box-shadow: 0 0 0 4px rgba(11, 59, 92, 0.06);
}

.bar-search-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #7a8b99;
}

.bar-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 420;
  color: #1e1e1e;
  padding: 0.4rem 0.25rem;
  outline: none;
  letter-spacing: -0.005em;
  min-width: 0;
}

.bar-search-input::placeholder {
  color: #9aacb9;
  font-weight: 380;
}

.bar-go-btn {
  background: #0b3b5c;
  color: white;
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: 48px;
  font-size: 0.85rem;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 10px -4px rgba(11, 59, 92, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}

.bar-go-btn:hover {
  background: #0a2e47;
  box-shadow: 0 8px 18px -6px rgba(11, 59, 92, 0.4);
}

.bar-go-btn:active {
  transform: scale(0.97);
  background: #082538;
}

.bar-go-btn::after {
  content: "?";
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.bar-go-btn:hover::after {
  transform: translateX(3px);
}

/* =============================================
   AREA 3 : MAIN CONTENT
   ============================================= */
.main-content {
  background: white;
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  border-radius: 32px;
  box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.08), 0 8px 12px -4px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.02);
  text-align: center;
}

.main-content h1 {
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #1e1e1e;
  margin-bottom: 1rem;
}

.main-content .description {
  color: #5e5e5e;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  font-weight: 350;
}

/* search feedback */
.search-feedback {
  min-height: 1.4rem;
  font-size: 0.88rem;
  color: #3b6e8f;
  margin-bottom: 1.5rem;
  font-weight: 450;
  letter-spacing: -0.005em;
}

.search-feedback.error {
  color: #c0392b;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e8eef4, transparent);
  margin: 1.8rem 0;
}

/* current selection */
.current-topic {
  font-size: 0.95rem;
  color: #3b6e8f;
  background: #f2f8fe;
  padding: 0.55rem 1.3rem;
  border-radius: 40px;
  display: inline-block;
  border: 1px solid #d9e7f2;
}

.current-topic strong {
  font-weight: 550;
  color: #0b3b5c;
}

.hint {
  margin-top: 1.8rem;
  font-size: 0.78rem;
  color: #9a9a9a;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Background decoration */
.bg-blob {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at 30% 30%, rgba(200, 220, 240, 0.3), transparent 70%);
  border-radius: 50%;
  bottom: -100px;
  right: -100px;
  z-index: -1;
  pointer-events: none;
}

.bg-blob-2 {
  position: fixed;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle at 70% 20%, rgba(210, 230, 250, 0.25), transparent 70%);
  border-radius: 50%;
  top: -80px;
  left: -80px;
  z-index: -1;
  pointer-events: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  body {
    padding: 16px;
  }
  .top-row {
    gap: 10px;
    margin-bottom: 22px;
  }
  .icon-btn {
    width: 46px;
    height: 46px;
  }
  .icon-btn svg {
    width: 22px;
    height: 22px;
  }
  .compact-bar {
    height: 46px;
    padding: 0 12px;
    gap: 8px;
  }
  .bar-title {
    font-size: 1.05rem;
  }
  .bar-search {
    padding-left: 10px;
  }
  .bar-search-input {
    font-size: 0.82rem;
  }
  .bar-go-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
  }
  .main-content {
    padding: 2rem 1.2rem;
  }
}

@media (max-width: 460px) {
  .bar-title {
    display: none;  /* hide title on very small screens to keep search usable */
  }
  .bar-search-icon {
    display: none;
  }
  .bar-search {
    padding-left: 12px;
  }
}
